package com.yf.cassandra.utils;

import java.util.Arrays;

/**
 * @Author: yangfeng
 * @Date: 2020/9/11 14:19
 * Email: Feng.Yang@things-matrix.com
 */
public enum MonthEnum {

    july(0, "2020-07"),
    august(1, "2020-08"),
    september(2, "2020-09");

    private int type;
    private String value;

    MonthEnum() {
    }

    MonthEnum(int type, String value) {
        this.type = type;
        this.value = value;
    }

    public int getType() {
        return type;
    }

    public String getValue() {
        return value;
    }

    public static MonthEnum get(int type) {
        return Arrays.stream(MonthEnum.values()).filter(monthEnum -> monthEnum.getType() == type).findFirst().get();
    }
}
